package com.gjp;

import com.gjp.bean.User;
import com.gjp.utils.JWT;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.UnsupportedEncodingException;

@SpringBootApplication
public class JwtDemoApplication {

//	public static void main(String[] args) {
//		SpringApplication.run(JwtDemoApplication.class, args);
//	}

    public static void main(String[] args) throws UnsupportedEncodingException {
        User user = new User();
        user.setUsername("张三");
        user.setPassword("123456");
		String token = JWT.sign(user, 10000);
		System.out.println(token);
		System.out.println(token.length());
		System.out.println(JWT.unsign(token, User.class));
    }
}
